package cn.ichiva.game.poker.ddz.cardType.impl;

import cn.ichiva.game.poker.ddz.Card;
import cn.ichiva.game.poker.ddz.ICardType;

import java.util.Arrays;

import static cn.ichiva.game.poker.ddz.Card.*;

/**
 * @Description 单牌
 * @auther Chiva 874460517@qq.com
 * @create 2020-01-13 16:04
 */
public abstract class CardType implements ICardType {

    protected final Card[] cards;

    public CardType(Card[] cards){
        asc(cards);
        this.cards=cards;
    }

    public Card[] getCards() {
        return cards;
    }

    public static void asc(Card[] cards){
        Arrays.sort(cards,(c1,c2)->{ return c1.getIndex() - c2.getIndex(); });
    }
}
